export interface EstimateApiRes {
  Datas: string[];
  ErrCode: number;
  ErrMsg?: any;
  TotalCount: number;
  Expansion: Expansion;
}

interface Expansion {
  FCODE: string;
  SHORTNAME: string;
  GZTIME: string;
  GZ: string;
  GSZZL: string;
  GZZF: string;
  SGZT: string;
  SHZT: string;
  SOURCERATE: string;
  rate: string;
  DTZT: string;
  ISBUY: string;
  JZRQ: string;
  DWJZ: string;
  BUY: boolean;
  Market: string;
}

export interface FunData {
  backTest?: number;
  name?: string;
  curVal?: number;
  estimate?: number;
  hisValList?: any[];
}

export interface HisVal {
  Datas: HisValItem[];
  ErrCode: number;
  ErrMsg?: any;
  TotalCount: number;
  Expansion?: any;
}

export interface HisValItem {
  FSRQ: string;
  DWJZ: string;
  JZZZL: string;
  LJJZ: string;
  NAVTYPE: string;
  RATE: string;
  FHFCZ: string;
  FHFCBZ: string;
  Remarks: string;
}

export interface Last3nBackTest {
  summary: Summary;
  managers: Manager[];
  performance: Performance;
  fundHolding: FundHolding;
  assetPortfolios: AssetPortfolio[];
  industryPortfolios: AssetPortfolio[];
  netAssetHistory: NetAssetHistory[];
  tradeLimit: TradeLimit;
  isUserPicked: boolean;
  configuration: Configuration;
}

interface Configuration {
  fundCode: string;
  tipsInfo?: any;
}

interface TradeLimit {
  canAllot: boolean;
  cannotAllotReason?: any;
  uiCannotAllotReasonText?: any;
  canSubscribe: boolean;
  cannotSubscribeReason: CannotSubscribeReason;
  uiCannotSubscribeReasonText: string;
  canRedeem: boolean;
  cannotRedeemReason?: any;
  uiCannotRedeemReasonText?: any;
  canConvert: boolean;
  cannotConvertReason?: any;
  uiCannotConvertReasonText?: any;
  redeemToWalletTransferIntoTxnDays: number;
  redeemToWalletTransferIntoTxnDayDate: number;
  redeemToCardTransferIntoTxnDays: number;
  redeemToCardTransferIntoTxnDayDate: number;
  redeemToWalletHasIncomeTxnDays: number;
  redeemToWalletHasIncomeTxnDayDate: number;
  redeemToCardHasIncomeTxnDays: number;
  redeemToCardHasIncomeTxnDayDate: number;
  toWalletThanToCardMultiIncomeTxnDays: number;
  minDiscount: number;
  feeRatio: number;
  personalLowestAllotAmount: number;
  currentTxnDate: number;
  buyExpectConfirmDate: number;
  incomeVisibleDate: number;
  largeLimitAmount: number;
}

interface CannotSubscribeReason {
  code: string;
  msg: string;
}

interface NetAssetHistory {
  date: number;
  uiQuarterText: string;
  netAsset: number;
}

interface AssetPortfolio {
  name: string;
  ratio: number;
  value: number;
}

interface FundHolding {
  fundCode: string;
  fundInvestRatio?: any;
  fundInvests: any[];
  stockInvestRatio: number;
  stockInvests: StockInvest[];
  bondInvestRatio: number;
  bondInvests: StockInvest[];
}

interface StockInvest {
  code: string;
  name: string;
  ratio: number;
  amount: number;
}

interface Performance {
  metricsAnalyzes: MetricsAnalyze[];
  stageReturns: StageReturn[];
}

interface StageReturn {
  stageType: string;
  uiStageText: string;
  similarAvgReturn: number;
  stageReturn: number;
  rankText: string;
}

interface MetricsAnalyze {
  stageType: string;
  uiStageText: string;
  isDefault: boolean;
  isValid: boolean;
  uiInvalidText?: any;
  metrics: Metric[];
}

interface Metric {
  title: string;
  quartileRank: number;
  desc: string;
  metricsValue: number;
  metricsValueText: number | string;
  rankText: string;
}

interface Manager {
  fundManagerId: number;
  fundManagerName: string;
  avatarUrl: string;
  curtDesc: string;
  periodYears: number;
  periodReturn: number;
  periodAnnualCompoundedReturn: number;
}

interface Summary {
  fundCode: string;
  fundName: string;
  taxDeferredType: string;
  fundInvestType: string;
  fundTags: FundTag[];
  oneYearReturn: number;
  setupDayReturn: number;
  risk5Level: number;
  setupDate: number;
  uiSetupDate: string;
  valDisBy: string;
  nav: number;
  navDate: number;
  dailyReturn: number;
  yearlyRoe?: any;
  unitYield?: any;
  unitYieldDate: number;
  netAsset: number;
  netAssetUpdateDate: number;
  morningstarRating: number;
  benchmarks: Benchmark[];
  displayEstimateNav: boolean;
  issueInfo: IssueInfo;
  lockedType: string;
}

interface IssueInfo {
  issueStartDate: number;
  issueEndDate: number;
  issuePeriodStatus: string;
  issuePreviouslyCountdownEndTime: number;
  canSubPresellNotice: boolean;
}

interface Benchmark {
  code: string;
  name: string;
  shortName: string;
}

interface FundTag {
  type: string;
  text: string;
}

export interface FundsObj {
  requestFail: number;
  resolveFail: number;
  code: string;
  name: string;
  type: string;
  netWorth: number;
  expectWorth: number;
  totalWorth: number;
  expectGrowth: string;
  dayGrowth: string;
  lastWeekGrowth: string;
  lastMonthGrowth: string;
  lastThreeMonthsGrowth: string;
  lastSixMonthsGrowth: string;
  lastYearGrowth: string;
  buyMin: string;
  buySourceRate: string;
  buyRate: string;
  manager: string;
  fundScale: string;
  netWorthDate: string;
  expectWorthDate: string;
  netWorthData: string[][];
  totalNetWorthData: string[][];
}

